Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make Weak::ptr_eqs into methods #61893

Merged
merged 1 commit into from
Jun 18, 2019
Merged

Conversation

chpio
Copy link
Contributor

@chpio chpio commented Jun 16, 2019

This makes the Weak::ptr_eqs associated function into methods. There's no reason for methods on Weaks to be associated functions, as there is no Dered thus no possibility of a collision. Also: methods can be called using the associated function syntax.

follow up on #55987
Tracking issue for weak_ptr_eq

@rust-highfive
Copy link
Collaborator

r? @rkruppe

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 16, 2019
@hanna-kruppe
Copy link
Contributor

hanna-kruppe commented Jun 16, 2019

I don't know how to weigh "can be a method" against consistency with the methods on the strong counterparts. Is there precedent for this in other associated functions?

@hanna-kruppe
Copy link
Contributor

cc @rust-lang/libs

@sfackler
Copy link
Member

I think it makes sense for these to be methods. Weak::upgrade is already one after all.

@hanna-kruppe
Copy link
Contributor

Ah, great. Let's do this, then. @bors r+

@bors
Copy link
Contributor

bors commented Jun 17, 2019

📌 Commit 387ac06 has been approved by rkruppe

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 17, 2019
Centril added a commit to Centril/rust that referenced this pull request Jun 17, 2019
make `Weak::ptr_eq`s into methods

This makes the `Weak::ptr_eq`s associated function into methods. There's no reason for methods on `Weak`s to be associated functions, as there is no `Dered` thus no possibility of a collision. Also: methods can be called using the associated function syntax.

follow up on rust-lang#55987
[Tracking issue for weak_ptr_eq](rust-lang#55981)
bors added a commit that referenced this pull request Jun 17, 2019
Rollup of 5 pull requests

Successful merges:

 - #61702 (test more variants of enum-int-casting)
 - #61836 (Replace some uses of NodeId with HirId)
 - #61885 (Help LLVM better optimize slice::Iter(Mut)::len)
 - #61893 (make `Weak::ptr_eq`s into methods)
 - #61908 (don't ICE on large files)

Failed merges:

r? @ghost
@bors bors merged commit 387ac06 into rust-lang:master Jun 18, 2019
@Thomasdezeeuw
Copy link
Contributor

Could no one have pinged me? I originally added this and this was merged before I even got a chance to even look at it...

@chpio chpio deleted the weak_ptr_eq_methods branch June 18, 2019 09:11
@chpio
Copy link
Contributor Author

chpio commented Jul 6, 2019

@Thomasdezeeuw yeah, sorry for that, i reffed the other issues but not you directly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants